package www.dianbaozu.com.ui.manage

import androidx.hilt.lifecycle.ViewModelInject
import www.wen.com.common.lib.base.module.BaseAbsViewModel
import www.wen.com.common.lib.data.entities.RequestBodyParameter
import www.wen.com.common.lib.data.entities.Result
import www.wen.com.common.lib.data.entities.ServiceMemberEntity
import www.wen.com.common.lib.data.entities.ServiceMemberListEntity
import www.wen.com.common.lib.data.repository.AppDataManager

class FindMemberUseApiViewModel @ViewModelInject constructor(appDataManager: AppDataManager) :
        BaseAbsViewModel<ServiceMemberListEntity, ServiceMemberEntity>(appDataManager) {

    override suspend fun requestListData(requiredParameter: Any): Result<ServiceMemberListEntity> {
        val body = requiredParameter as RequestBodyParameter
        return appDataManager.requestServersMemberList(body.serverId!!, body.nickName, mPage, mLimit)
    }

    override fun dataConversion(data: ServiceMemberListEntity): List<ServiceMemberEntity> {
        return data.content
    }

}